﻿/*------------------------------------------------
// File Description: ProductViaSiteBom DataBase Entity
// Author:			 汪亮
// Create Time:		 2020-05-04 19:15:11
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 过站BOM记录
    /// </summary>
    [Table(nameof(ProductViaSiteBom))]
    public class ProductViaSiteBom : BaseEntity
    {
        private string _orderNo = string.Empty;
        private string _workOrderNo = string.Empty;
        private string _barCode = string.Empty;
        private string _workshopCode = string.Empty;
        private string _workshopName = string.Empty;
        private string _machineName = string.Empty;
        private string _warehouseCode = string.Empty;
        private string _warehouseName = string.Empty;
        private string _productCode = string.Empty;
        private string _productName = string.Empty;
        private string _materielCategoryCode = string.Empty;
        private string _materielCategoryName = string.Empty;
        private string _materielCode = string.Empty;
        private string _materielName = string.Empty;
        private string _batchNo = string.Empty;
        private string _color = string.Empty;
        private string _factory = string.Empty;
        private string _specifications = string.Empty;

        #region Public Property

        ///<Summary>
        /// 订单号
        ///</Summary>
        public string OrderNo
        {
            get { return string.IsNullOrWhiteSpace(_orderNo) ? string.Empty : _orderNo; }
            set { _orderNo = value; }
        }

        ///<Summary>
        /// 工单号
        ///</Summary>
        public string WorkOrderNo
        {
            get { return string.IsNullOrWhiteSpace(_workOrderNo) ? string.Empty : _workOrderNo; }
            set { _workOrderNo = value; }
        }

        ///<Summary>
        /// 组件条码
        ///</Summary>
        public string BarCode
        {
            get { return string.IsNullOrWhiteSpace(_barCode) ? string.Empty : _barCode; }
            set { _barCode = value; }
        }

        ///<Summary>
        /// 车间代码
        ///</Summary>
        public string WorkshopCode
        {
            get { return string.IsNullOrWhiteSpace(_workshopCode) ? string.Empty : _workshopCode; }
            set { _workshopCode = value; }
        }

        ///<Summary>
        /// 车间名称
        ///</Summary>
        public string WorkshopName
        {
            get { return string.IsNullOrWhiteSpace(_workshopName) ? string.Empty : _workshopName; }
            set { _workshopName = value; }
        }

        ///<Summary>
        /// 班次ID
        ///</Summary>
        public int DutyId { get; set; }

        ///<Summary>
        /// 站点类型
        ///</Summary>
        public Enum.SiteType SiteType { get; set; }

        ///<Summary>
        /// 设备ID
        ///</Summary>
        public int MachineId { get; set; }

        ///<Summary>
        /// 设备名称
        ///</Summary>
        public string MachineName
        {
            get { return string.IsNullOrWhiteSpace(_machineName) ? string.Empty : _machineName; }
            set { _machineName = value; }
        }

        ///<Summary>
        /// 仓库代码
        ///</Summary>
        public string WarehouseCode
        {
            get { return string.IsNullOrWhiteSpace(_warehouseCode) ? string.Empty : _warehouseCode; }
            set { _warehouseCode = value; }
        }

        ///<Summary>
        /// 仓库名称
        ///</Summary>
        public string WarehouseName
        {
            get { return string.IsNullOrWhiteSpace(_warehouseName) ? string.Empty : _warehouseName; }
            set { _warehouseName = value; }
        }

        ///<Summary>
        /// 成品代码
        ///</Summary>
        public string ProductCode
        {
            get { return string.IsNullOrWhiteSpace(_productCode) ? string.Empty : _productCode; }
            set { _productCode = value; }
        }

        ///<Summary>
        /// 成品名称
        ///</Summary>
        public string ProductName
        {
            get { return string.IsNullOrWhiteSpace(_productName) ? string.Empty : _productName; }
            set { _productName = value; }
        }

        ///<Summary>
        /// 物料分类代码
        ///</Summary>
        public string MaterielCategoryCode
        {
            get { return string.IsNullOrWhiteSpace(_materielCategoryCode) ? string.Empty : _materielCategoryCode; }
            set { _materielCategoryCode = value; }
        }

        ///<Summary>
        /// 物料分类名称
        ///</Summary>
        public string MaterielCategoryName
        {
            get { return string.IsNullOrWhiteSpace(_materielCategoryName) ? string.Empty : _materielCategoryName; }
            set { _materielCategoryName = value; }
        }

        ///<Summary>
        /// 物料代码
        ///</Summary>
        public string MaterielCode
        {
            get { return string.IsNullOrWhiteSpace(_materielCode) ? string.Empty : _materielCode; }
            set { _materielCode = value; }
        }

        ///<Summary>
        /// 物料名称
        ///</Summary>
        public string MaterielName
        {
            get { return string.IsNullOrWhiteSpace(_materielName) ? string.Empty : _materielName; }
            set { _materielName = value; }
        }

        ///<Summary>
        /// 批次号
        ///</Summary>
        public string BatchNo
        {
            get { return string.IsNullOrWhiteSpace(_batchNo) ? string.Empty : _batchNo; }
            set { _batchNo = value; }
        }

        ///<Summary>
        /// 颜色
        ///</Summary>
        public string Color
        {
            get { return string.IsNullOrWhiteSpace(_color) ? string.Empty : _color; }
            set { _color = value; }
        }

        ///<Summary>
        /// 厂家
        ///</Summary>
        public string Factory
        {
            get { return string.IsNullOrWhiteSpace(_factory) ? string.Empty : _factory; }
            set { _factory = value; }
        }

        ///<Summary>
        /// 规格
        ///</Summary>
        public string Specifications
        {
            get { return string.IsNullOrWhiteSpace(_specifications) ? string.Empty : _specifications; }
            set { _specifications = value; }
        }

        ///<Summary>
        /// 数量
        ///</Summary>
        public decimal Quantity { get; set; }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 过站BOM记录
        /// </summary>
        public virtual DbSet<ProductViaSiteBom> ProductViaSiteBoms { get; set; }
    }
}